<?php 
	namespace Models;

	class Project
	{	
		private $app;
		private $access = 3;
		function __construct($app){
			$this->app = $app;
		}

		function getAll(){
			/*$sql = "SELECT idseries series_id, series_type, series_name, series_season, series_count, series_link, series_date FROM series";
			return json_encode($this->app['db']->fetchAll($sql));*/
		}

		function getOne($id){

			$sql = "SELECT idproject project_id, project_title title, project_text text, project_status, project_img, usersetting_display_name user_name FROM project, user_setting WHERE idproject = ? AND project.user_id = user_setting.user_id ";
			

			$res = $this->app['db']->fetchAssoc($sql, array( (int) $id ));	
			$res['text'] = htmlspecialchars_decode($res['text']);
			return $res;
		}

		function insert($data){
			
			return '';
		}

		function update($data){
			

		}

		function delete($data){
			
		}

	}

?>